// 并发断言在 Preponed 区域采样, 在 Observed 区域进行求值, 在 Reactive 区域执行动作语句

`timescale 1ns/1ns

module sva_ca_region;
    logic clk;
    initial begin
        clk = 0;
        forever #5 clk = ~clk; 
    end

    logic a, b;

    initial begin
            a=1; b=1;
        #15 a=0; b=0;
        #10 a=1; b=0; // <-- Assert Failed
        #10 a=0; b=0; 
        #10 a=1; b=1; // <-- Assert Failed
        #10;
        $finish;
    end

    ap: assert property(@(posedge clk) a || b); // 关键字 property 用于区分并发断言和立即断言

    // wave dump
    initial begin
        $dumpfile("wave.vcd"); $dumpvars;
    end
endmodule

/* Output: VCS
"sva_ca_region.sv", 24: sva_ca_region.ap: started at 25ns failed at 25ns
        Offending '(a || b)'
"sva_ca_region.sv", 24: sva_ca_region.ap: started at 45ns failed at 45ns
        Offending '(a || b)'
 */
